package com.scmt.hmzd.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 优惠券
 * </p>
 *
 * @author ycy
 * @since 2023-03-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="HmCoupon对象", description="优惠券")
public class HmCoupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "优惠券ID")
    @TableId(value = "coupon_id", type = IdType.AUTO)
    private Long couponId;

    @ApiModelProperty(value = "优惠券名称")
    private String couponName;

    @ApiModelProperty(value = "副标题")
    private String subTitle;


    @ApiModelProperty(value = "使用条件")
    private BigDecimal cashCondition;

    @ApiModelProperty(value = "减免金额")
    private BigDecimal reduceAmount;


    @ApiModelProperty(value = "领券后X天起生效")
    private Integer afterReceiveDays;

    @ApiModelProperty(value = "有效天数")
    private Integer validDays;

    @ApiModelProperty(value = "库存")
    private Integer stocks;

    @ApiModelProperty(value = "每个用户领券上限，如不填则默认为1")
    private Integer limitNum;

    @ApiModelProperty(value = "优惠券过期状态 0:过期 1:未过期")
    private Integer overdueStatus;

    @ApiModelProperty(value = "原始库存")
    private Integer sourceStock;


    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "删除状态")
    @TableLogic
    private Integer delFlag;



    @ApiModelProperty(value = "开始时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date userStartTime;

    @ApiModelProperty(value = "结束时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date userEndTime;


    @ApiModelProperty(value = "优惠券领取次数")
    @TableField(exist = false)
    private Integer takeNum = 0;

    @ApiModelProperty(value = "优惠券使用次数")
    @TableField(exist = false)
    private Integer useNum = 0;


    @ApiModelProperty(value = "是否领取过")
    @TableField(exist = false)
    private Integer status = 0;

}
